package com.example.demo.service;

import com.example.demo.repository.primary.JobQueuesRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * Created by dongjunpeng on 2017/10/16.
 */
@Service
public class JobQueuesService {

    private JobQueuesRepository jobQueuesRepository;

    public JobQueuesService(JobQueuesRepository jobQueuesRepository) {
        this.jobQueuesRepository = jobQueuesRepository;
    }

    /**
     * @author ZSP
     * @description 获取集装箱前后位置
     */
    public String getPositionByVesselContainerRecords(String vesselVoyageNumber, String containerNumber, String jobType) {
        Optional<String> position = jobQueuesRepository.getPositionByVesselContainerRecords(vesselVoyageNumber, containerNumber, jobType);
        return position.orElse("");
    }
}
